<!DOCTYPE HTML>
<html>
<head>

    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <title>详情</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/css/uploadifive.css">
    <link type="text/css" rel="stylesheet" href="/js/plugins/layer/laydate/skins/default/laydate.css" id="LayDateSkin">


</head>
<body>
<h2>{{if .update}}更新{{else}}添加{{end}}</h2>
<!--style给定宽度可以影响编辑器的最终宽度-->

<!--style给定宽度可以影响编辑器的最终宽度-->
<form id="FORM_validate" action="/usercoupon/{{if .update}}update{{else}}add{{end}}" method="post">
    <input id="form_Id" type="hidden" value="{{if .update}}{{.UserCoupon.Id}}{{end}}" name="{{if .update}}Id{{end}}">
    <div class="">
    	<div class="form-group col-md-12">
            <label class="col-md-3 control-label">优惠券编号：</label>
            <div class="col-md-9">
                <input id="form_CouponId" name="CouponId" class="form-control" placeholder="请在此输入" value="{{if .update}}{{.UserCoupon.CouponId}}{{end}}">
            </div>
        </div>
		<div class="form-group col-md-12">
            <label class="col-md-3 control-label">得主编号：</label>
            <div class="col-md-9">
                <input id="form_UserId" name="UserId" class="form-control" placeholder="请在此输入" value="{{if .update}}{{.UserCoupon.UserId}}{{end}}">
            </div>
        </div>
		<div class="form-group col-md-12">
            <label class="col-md-3 control-label">优惠券获取时间：</label>
            <div class="col-md-9">
                <input placeholder="YYYY-MM-DD hh:mm:ss" name="coupongettime"
                       value="{{if .update}}{{date .UserCoupon.CouponGetTime "Y-m-d H:i:s"}}{{end}}"
                       onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                       class="laydate-icon form-control layer-date"
                       required="" aria-required="true">
            </div>
        </div>
		<div class="form-group col-md-12">
            <label class="col-md-3 control-label">优惠券结束时间：</label>
            <div class="col-md-9">
                <input placeholder="YYYY-MM-DD hh:mm:ss" name="couponendtime"
                       value="{{if .update}}{{date .UserCoupon.CouponEndTime "Y-m-d H:i:s"}}{{end}}"
                       onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                       class="laydate-icon form-control layer-date"
                       required="" aria-required="true">
            </div>
        </div>
		<div class="form-group col-md-12">
            <label class="col-md-3 control-label">满减阈值：</label>
            <div class="col-md-9">
                <input id="form_CouponLeastDiscount" name="CouponLeastDiscount" class="form-control" placeholder="请在此输入" value="{{if .update}}{{.UserCoupon.CouponLeastDiscount}}{{end}}">
            </div>
        </div>
		<div class="form-group col-md-12">
            <label class="col-md-3 control-label">满减额度：</label>
            <div class="col-md-9">
                <input id="form_CouponDiscount" name="CouponDiscount" class="form-control" placeholder="请在此输入" value="{{if .update}}{{.UserCoupon.CouponDiscount}}{{end}}">
            </div>
        </div>
		<div class="form-group col-md-12">
            <label class="col-md-3 control-label">优惠券信息：</label>
            <div class="col-md-9">
                <input id="form_CouponMessage" name="CouponMessage" class="form-control" placeholder="请在此输入" value="{{if .update}}{{.UserCoupon.CouponMessage}}{{end}}">
            </div>
        </div>
		<div class="form-group col-md-12">
            <label class="col-md-3 control-label">优惠券所属卖家：</label>
            <div class="col-md-9">
                <input id="form_CouponUser" name="CouponUser" class="form-control" placeholder="请在此输入" value="{{if .update}}{{.UserCoupon.CouponUser}}{{end}}">
            </div>
        </div>
		
    	<div class="form-group col-md-12">
            <div class="col-md-12 col-md-offset-3">
                <button class="btn btn-primary" type="submit">保存内容</button>
                {{if .update}}{{else}}
                <button class="btn btn-white" type="submit">取消</button>
                {{end}}
            </div>
        </div>
    </div>
</form>



<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/jquery.uploadifive.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="/js/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/ueditor.all.min.js"></script>
<script type="text/javascript" src="/lang/zh-cn/zh-cn.js"></script>
<script src="/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/js/plugins/validate/messages_zh.min.js"></script>


<!-- jQuery UI -->
<script src="/js/jquery-ui-1.10.4.min.js"></script>
<!-- laydate js -->
<script src="/js/plugins/layer/laydate/laydate.js"></script>

<!--form validate-->
<script>
    $().ready(function () {
        // validate the comment form when it is submitted
        $("#FORM_validate").validate({
            rules: {
                CouponId:{
                    required:true,
                    digits:true
                },
                UserId:{
                    required:true,
                    digits:true
                },
                CouponLeastDiscount:{
                    required:true,
                    numbers:true
                },
                CouponDiscount:{
                    required:true,
                    numbers:true
                },
                CouponMessage:{
                    required:true,
                    minlength: 2
                },
                CouponUser:{
                    required:true,
                    digits:true
                },
            }
        });
    });
</script>




</body>
</html>